package com.typhoon.spring_boot_demo1.constants;

import java.io.Serializable;

/**
 * Created by hujun on 2017/3/15.
 */
public class EntityError implements Serializable {

    protected int    code;
    protected String msg;

    public static final EntityError IP_LIMIT               = new EntityError(400, "IP访问受限");
    public static final EntityError TIMEOUT                = new EntityError(510, "访问超时");
    public static final EntityError SAVE_DB_ERROR          = new EntityError(500, "保存数据库错误");
    public static final EntityError SERVICE_UNAVAILABLE    = new EntityError(502, "服务不可用");
    public static final EntityError CACHE_ERROR            = new EntityError(511, "缓存不可用");
    public static final EntityError DB_ERROR               = new EntityError(512, "数据库不可用");
    public static final EntityError INVOKE_ERROR           = new EntityError(513, "方法执执行出错");
    public static final EntityError PASSWORD_ERROR         = new EntityError(402, "密码错误");
    public static final EntityError UNLOGIN                = new EntityError(404, "未登录");
    public static final EntityError ILLEGAL_ARGUMENT_ERROR = new EntityError(405, "参数非法");
    public static final EntityError UNKNOWN_ERROR          = new EntityError(406,"未知错误");
    public static final EntityError S_OK                   = new EntityError(0, "执行成功");
    public static final EntityError SYSTEM_ERROR           = new EntityError(999, "系统错误");
    public static final EntityError MEMBER_NOTEXISTS       = new EntityError(610,"会员不存在");
    public static final EntityError MEMBER_NOT_SALECASE    = new EntityError(611,"会员不在库中");

    public static final EntityError WORKER_NOT_EXISTS    = new EntityError(612,"员工不存在");
    public static final EntityError WORKER_HAS_LEAVE    = new EntityError(613,"员工已离职");
    public static final EntityError RECORD_NOT_EXISTS = new EntityError(614,"录音编号不存在");
    public static final EntityError IN_SALECASE = new EntityError(615,"会员已存在机会库中");
    public static final EntityError IN_VIRTUALCASE = new EntityError(616,"会员已存在虚拟库中");

    public static final EntityError ALLOT_FAILED = new EntityError(617,"分配失败");

    public EntityError() {
    }

    public EntityError(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
